package cn.itcast.ssm.dao;

import cn.itcast.ssm.domain.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IProductDao {
    @Select("select * from product")
    List<Product> findAll();

    @Select("select * from product where id=#{id}")
    Product findById(String id);

    @Insert("insert into product(productNum, productName,cityName, departureTime,  productPrice, productDesc, productStatus) values(#{productNum}, #{productName}, #{cityName}, #{departureTime, jdbcType=TIMESTAMP}, #{productPrice, jdbcType=NUMERIC}, #{productDesc}, #{productStatus})")
    void save(Product product);
}
